<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <img :src="imgpath" alt="" @mouseover="changePic(true)" @mouseout="changePic(false)"><br>
        <button @click="changeImg()">变图</button>
    </div>
</body>
</html>
<script>
    var vm=new Vue({
        el:'#app',
        data:{
            imgpath:'images/qwe.jpg'
        },
        methods:{
            changeImg(){
                this.imgpath="images/asd.jpg"
            },
            changePic(flag){
                if(flag){
                    this.imgpath='images/asd.jpg'
                }else{
                    this.imgpath='images/qwe.jpg'
                }
            }
        }
    })
</script>